Apparatus and Method for Testing Storage Device in Power Interruptions

ABSTRACT

A programmable testing apparatus imposes power interruptions on a storage device at any given point of time under at least one workload according to at least one protocol for tests. The programmable testing apparatus includes a controller unit connected to a workload unit, a power control unit, a protocol control unit and a data buffer unit. The controller unit calculates and receives and replies commands in the tests. The workload unit imposes various workloads on the storage device. The power control unit imposes power interruptions on the storage device under control of the controller unit. The protocol control unit provides commands according to the protocol for tests. The data buffer unit stores critical data and information to check whether data stored in the storage device are correct.

BACKGROUND OF INVENTION 1. Field of Invention

The present invention relates to an apparatus and method for testingstorage device in power interruptions and, more particularly, to aprogrammable apparatus and method for testing storage device in powerinterruptions.

2. Related Prior Art

When used as a storage device, a typical solid-state disk (“SSD”)includes a port such as a SATA, SAS and fiber channel for connection toa computer port via a bus. However, the SATA is designed for a hard diskdrive (“HDD”), and gets less and less useful for SSDs that get fasterand faster. Hence, the performance of some SSDs is limited by theperformance of the SATA.

A non-volatile memory express (“NVMe”) is a logic device port protocolthat is an excellent, high-performance and expansible host controllerinterface. The primary concept of the NVMe is provision of atransmission loop of a direct processor via a peripheral componentinterconnect express (“PCIe”). Advantageously, the access to the NVMeexhibits low latency and high frequency. Moreover, the NVMe isadvantageous in power consumption management for providing automaticpower consumption state switch and dynamic energy consumptionmanagement.

A storage device has to undergo tests for endurane under a workload suchas sequential access, random access, and access to large or small files.Storage device for consumers undergo a different degree of tests fromstorage device for enterprises. For the tests, there are variousregulations such as JESD 218 and JESD 219. The tests are intended toensure that each storage device exhibits proper durability and quality.

Conventionally, a storage device is tested under a workload in manyrounds and/or for a long period of time. Requirements and environmentsfor tests are set forth in the regulations. Regarding the durability andreliability, a storage device is tested according to experience or for along period of time. Conventional firmware of a storage device might beable to cope with normal loss of power. However, the firmware couldeasily ignore power interruptions and jeopardize the retention of auser's data, an essential performance of the storage device. If a powerinterruption occurs and the firmware ignores it, the user's data coulddisappear, the system could crash, the firmware of the storage devicecould fail to access to the user's data, or initialization of thestorage device could fail in the first place.

Conventionally, an operation system executes an application softwareprogram to test a storage device, power interruptions are executed in aregular manner. Hence, flexibility and complexity of a testing routineare limited. In addition, the power interruptions are done in a regularmanner, and this is not satisfactory. Alternatively, a person imposespower interruptions on the storage device randomly. However, the personcannot execute power interruptions precisely at given points in theexecution of a command or routine under various workloads. Hence, it isdifficult to thoroughly locate problems with the firmware related topower interruptions. Moreover, in every round, conventional testingequipment tests the storage device in only one manner such as acommand/routine test, an initialization test and a pressure test, notallowing a testing person to change the manners for testing any time heor she likes.

The present invention is therefore intended to obviate or at leastalleviate the problems encountered in prior art.

SUMMARY OF INVENTION

It is an objective of the present invention to provide an apparatus fortesting a storage device in power interruptions by simulating variouspower interruptions in programmable manner so that flaws of firmware ofthe storage device can be detected effectively and efficiently and thatstability and reliability of the storage device are improved.

It is another objective of the present invention to provide an apparatusfor testing a storage device in power interruptions by simulating powerinterruptions in given commands or routines without having to wait forreplies from the given commands or routines, thereby rendering testseffective.

It is another objective of the present invention to provide an apparatusfor testing a storage device in power interruptions by simulatingvarious combinations of different types of power interruptions.

To achieve the foregoing objectives, the programmable testing apparatusimposes power interruptions on a storage device at any given point oftime under at least one workload according to at least one protocol fortests. The programmable testing apparatus includes a controller unitconnected to a workload unit, a power control unit, a protocol controlunit and a data buffer unit. The controller unit calculates and receivesand replies commands in the tests. The workload unit imposes variousworkloads on the storage device. The power control unit imposes powerinterruptions on the storage device under control of the controllerunit. The protocol control unit provides commands according to theprotocol for tests. The data buffer unit stores critical data andinformation to check whether data stored in the storage device arecorrect.

Other objectives, advantages and features of the present invention willbe apparent from the following description referring to the attacheddrawings.

BRIEF DESCRIPTION OF DRAWINGS

The present invention will be described via detailed illustration of thepreferred embodiment referring to the drawings wherein:

FIG. 1 is a block diagram of an apparatus for testing storage device inpower interruptions according to the preferred embodiment of the presentinvention;

FIG. 2 is a flow chart of a method for testing storage device in powerinterruptions, using the apparatus shown in FIG. 1; and

FIG. 3 is a flow chart of a portion of the method shown in FIG. 2.

DETAILED DESCRIPTION OF PREFERRED EMBODIMENT

Referring to FIG. 1, a programmable apparatus 10 for testing storagedevice 20 in power interruptions according to the preferred embodimentof the present invention. The storage device 20 is preferably an NVMesolid-state drive that includes multiple NAND flash memories 22controlled by a controller unit 21. The programmable testing apparatus10 is operable to impose power interruptions on the storage device 20and then check the storage device 20. The programmable testing apparatus10 imposes power interruptions on the storage device 20 under variousworkloads including but not limited to continuous access, random accessand access to large or small files. Thus, problems with firmware andalgorithms run in the storage device 20 can be found and then solvedquickly. Hence, the stability and reliability of the storage device 20are improved.

The programmable testing apparatus 10 includes a controller unit 11, aworkload unit 12, a power control unit 13, a protocol control unit 14,and a data buffer unit 15. The programmable testing apparatus 10 isconnected to the storage device 20 selectively via the power controlunit 13 or the protocol control unit 14.

The controller unit 11 is used to receive and transmit commands in thetests to complete execution of commands including but not limited tochanging the types of power interruptions, the total number of tests,cycles (or “sequences”) of the tests and calculation of results of thetests.

The workload unit 12 is connected to the controller unit 11 so that thecontroller unit 11 can instruct the workload unit 12 to impose variousworkloads on the storage device 20. The workload unit 12 is used todescribe a ratio of actions over commands executed by the storage device20 on a user's site according to JDEC 218 and 219 for example. Theworkloads include continuous access, random access and access to largeor small files. The contexts of the workloads are determined accordingto product positioning of the storage device 20 such as word-processing,game-playing or email-handling. The workload unit 12 is intended tosimulate actions taken in the storage device 20 on the user's site.

The power control unit 13 is connected to the controller unit 11. Thepower control unit 13 can be selectively connected to the storage device20. Thus, the controller unit 11 can instruct the power control unit 13to turn on and off the storage device 20.

The protocol control unit 14 is also connected to the controller unit11. The protocol control unit 14 can be selectively connected to thestorage device 20. Thus, the controller unit 11 can instruct theprotocol control unit 14 to send corresponding test protocols such asthose related to a command/routine test mode, an initialization testmode and a pressure test mode. The protocol control unit 14 is intendedto check, compare and determine whether the storage device 20 succeed orfail in the tests.

The data buffer unit 15 is also connected to the controller unit 11. Thedata buffer unit 15 is used to record critical data and information tofacilitate the protocol control unit 14 to check where the data storedin the storage device 20 is correct. The critical data recorded in thedata buffer unit 15 include lengths and addresses of N entries of datastored in the storage device 20 before power interruption and other dataareas that cannot be overwritten.

As mentioned above, the programmable testing apparatus 10 is used totest the storage device 20 according to JDEC 218 and 219 for example.The programmable testing apparatus 10 executes a testing method shown inFIGS. 2 and 3.

At S101, the storage device 20 is operated to execute at least onesimulated workload. Based on settings in the workload unit 12, thecontroller unit 11 actuates the storage device 20 to execute at leastone simulated workload such as continuous access, random access andaccess to large or small files.

Then, at S102, at least one power interruption is imposed on the storagedevice 20 according to a setting. In practice, the power control unit 13of the programmable testing apparatus 10 imposes power interruptions onthe storage device 20 under the simulated workload at various points oftime. The protocol control unit 14 is operable to set the modes of thepower interruptions imposed on the storage device 20. As mentionedabove, the modes include but not limited to a command/routine test moderepresented by ‘A’, an initialization test mode represented by ‘B’ and apressure test mode represented by ‘C.’

In the command/routine test mod, power interruptions are imposed on thestorage device 20 in the execution of a command and/or a routine. Aroutine includes multiple commands. Two steps represented by ‘S1022’ and‘S1023’ are taken in the command/routine test mode.

In the initialization test mode, the storage device 20 is turned on andinitialized again after it is turned off, and power interruptions areimposed on the storage device 20 in the initialization. Four stepsrepresented by ‘S1026’, ‘S 1027’, ‘S1028’ and ‘S1029’ are taken in theinitialization test mode.

At S1022, power interruptions are imposed on the storage device 20 inthe execution of a command and/or a routine.

At S1023, it is determined whether to execute the initialization testmode. The process goes to S1026 if the initialization test mode is to beexecuted and goes to S103 if otherwise.

At S1026, the storage device 20 is turned on and initialized again afterit is turned off.

Then, at S1027, CC.EN is set to be ‘1.’ According to NVMe, theprogrammable testing apparatus 10 repeatedly reads CSTS.RDY of datatemporarily stored in the storage device 20 until CSTS.RDY is turnedinto “1” from “0” when CC.EN is “1.” In the transition of CSTS.RDY, thedata storage device 20 must obey a Timeout value of the controller unit21. The storage device 20 is ready for work and the programmable testingapparatus 10 can execute further commands on the storage device 2 whenCSTS.RDY is “1.”

Then, at S1028, power interruptions are imposed on the storage device 20in an average period for initializing the storage device 20. In thetransition of CSTS.RDY, the firmware might be handling an uncompletedtask such as GC, WL and POR, or accessing to or moving data in the flashmemory 22. Hence, addition of programmable parameters and powerinterruptions could very likely expose flaws (or “bugs”) of thefirmware.

Then, at S1029, it is determined whether conditions for theinitialization test mode are fulfilled. The storage device 20 determineswhether all conditions of designated tests have been fulfilled. Theprocess goes to S103 if all conditions of designated tests have beenfulfilled and returns to S1026 if otherwise.

Various combinations of the command/routine test mode with theinitialization test mode can be programed. The pressure test mode can beany combination of the command/routine test mode with the initializationtest mode. In the pressure test mode, the command/routine test mode isexecuted for multiple times and/or the initialization test mode isexecuted for multiple times. Preferably, the command/routine test modeis executed for a large number of times, and so is the initializationtest mode.

Then, at S103, the storage device 20 is turned on again, and it isdetermined whether a period for initializing the storage device 20 isnormal. The power control unit 13 turns on the storage device 20 againafter turning off the storage device 20 at the given point of time. Theprotocol control unit 14 determines whether the time spent oninitializing the data storage device 20 for the re-operation is normal.The process goes to S104 if the period for initializing the storagedevice 20 is normal. Otherwise, the storage device 20 is determined tofail.

Then, at S104, it is determined whether the pressure test mode has beenfulfilled. The controller unit 11 determines whether a programmedcombination of the command/routine test mode with the initializationtest mode is fulfilled. The process goes to S105 if the programmedcombination of the command/routine test mode with the initializationtest mode is fulfilled, and returns to S102 (S1022 or S1026 in specific)if otherwise.

Then, at S105, it is determined whether critical data of the storagedevice 20 is correct. The controller unit 11 uses the data buffer unit15 to determine whether the critical data in the storage device 20 arecorrect. The critical data include but not limited to the length andaddresses of N entries of data written in the storage device 20 beforethe storage device 20 is turned off and other data areas that cannot beoverwritten. The process goes to S105 if the critical data is correct,and the storage device 20 is determined to fail if otherwise.

At S106, it is determined whether requirements for tests have beenfulfilled. In detail, it is determined whether required methods fortests, required cycles (or “sequences”) of tests and a required numberof each of the required cycles of tests have been fulfilled. The processreturns to S101 if the requirements for tests have not been fulfilled.The storage device 20 is determined to pass the tests and the processends if the requirements for tests have not been fulfilled.

After a power interruption, it must be checked whether theinitialization of CSTS.RDY of the storage device 20 according to NVMe iscompleted in Timeout regulated by NVMe. Very likely, something has gonewrong with the firmware of the storage device 20 in the powerinterruption if the storage device 20 fails the test. Damages of thefirmware of the storage device 20 caused by power interruptions must beexamined and repaired.

The apparatus and method of the present invention for testing thestorage device 20 according to NVMe exhibits several advantageousfeatures.

Firstly, the command/routine test mode is executed in a programmablemanner. Thus, a power interruption can be done at any given point oftime in the execution of any given command. Hence, the locations of theflaws of the firmware of the storage device 20 can be detected moreprecisely in the present invention than in the prior art.

Secondly, the initialization test mode is executed in a programmablemanner. Thus, various actions can be taken according to NVMe in thetests, and a power interruption can be done in any given actionaccording to NVMe.

Thirdly, the pressure test mode is executed in a programmable manner.Thus, the pressure test mode can be any desired combination of thecommand/routine test mode with the initialization test mode. Hence, thepresent invention can find more flaws of the firmware of the storagedevice 20 and faster than the prior art.

As mentioned above, the locations of the flaws of the firmware of thestorage device 20 can be detected precisely, and the flaws of hefirmware of the storage device 20 can be detected thoroughly. Hence, theflaws of the firmware of the storage device can be detected and repairedeffectively, and the storage device 20 can be stable and reliable afterthe tests and repair.

The present invention has been described via the illustration of thepreferred embodiment. Those skilled in the art can derive variationsfrom the preferred embodiment without departing from the scope of thepresent invention. Therefore, the preferred embodiment shall not limitthe scope of the present invention defined in the claims.

1. A programmable testing apparatus for imposing power interruptions ona storage device at any given point of time under at least one workloadaccording to at least one protocol for tests, the programmable testingapparatus comprising: a controller unit (11) for calculating andreceiving and replying commands in the tests; a workload unit (12)connected to the controller unit (11) and operable to impose variousworkloads on the storage device (20); a power control unit (13)connected to the controller unit (11) and the storage device (20), thepower control unit (13) imposing power interruptions on the storagedevice (20) under control of the controller unit (11); a protocolcontrol unit (14) connected to the controller unit (11) and the storagedevice (20), the protocol control unit (14) being operable to providecommands according to the protocol for tests; and a data buffer unit(15) connected to the controller unit (11) and operable to storecritical data and information to check whether data stored in thestorage device (20) are correct.
 2. The programmable testing apparatusaccording to claim 1, wherein the storage device (20) is an NVMe storagedevice.
 3. A testing method for imposing power interruptions on astorage device at any given point of time under at least one workloadaccording to at least one protocol for tests, the programmable testingapparatus comprising the steps of: imposing at least one simulatedworkload on the storage device (S101); imposing a cycle of at least onepower interruption on the storage device (S102); turning off the storagedevice; turning on the storage device again; determining whether aperiod for initializing the storage device is normal (S103); determiningthe storage device to fail if the period for initializing the storagedevice is not normal; determining whether the cycle has been completed(S104) if the period for initializing the storage device is normal;returning to the step of imposing a cycle of at least one powerinterruption on the storage device (S102) if the cycle has not beencompleted (S104); determining whether critical data of the storagedevice are correct (S105) if the cycle has been completed (S104);determining the storage device to fail if the critical data of thestorage device are not normal; determining whether the storage devicehas fulfilled conditions for tests (S106); returning to the step ofimposing at least one simulated workload on the storage device (S101) ifthe storage device has not fulfilled conditions for tests; and ending ifthe storage device has fulfilled the conditions for tests.
 4. The methodaccording to claim 3, wherein the cycle comprises at least one powerinterruption in execution of a command.
 5. The method according to claim3, wherein the cycle comprises at least one power interruption inexecution of a routine comprising multiple commands.
 6. The methodaccording to claim 3, wherein the cycle comprises at least one powerinterruption in initialization of the storage device.
 7. The methodaccording to claim 3, wherein the cycle comprises multiple powerinterruptions in execution of commands and multiple power interruptionsin execution of routines each of which comprises multiple commands. 8.The method according to claim 3, wherein the cycle comprises multiplepower interruptions in execution of commands, multiple powerinterruptions in execution of routines each of which comprises multiplecommands, and multiple power interruptions in initialization of thestorage device.
 9. The method according to claim 8, wherein the step ofimposing a cycle of at least one power interruption on the storagedevice (S102) comprises the step of determining whether to impose apower interruption in initialization of the storage device (S1023) afterimposing power interruptions in execution of commands and routines(S1022).
 10. The method according to claim 3, wherein the storage deviceis an NVMe storage device.